package pl.pawluk.inz.entities;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * Created with IntelliJ IDEA.
 * User: mandp
 * Date: 17.05.13
 * Time: 19:39
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "file_limitations", schema = "public", catalog = "")
@Entity
public class FileLimitationsEntity {
    private String type;

    @javax.persistence.Column(name = "type", nullable = false, insertable = true, updatable = true, length = 50, precision = 0)
    @Id
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    private Long maxSize;

    @javax.persistence.Column(name = "max_size", nullable = false, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Long getMaxSize() {
        return maxSize;
    }

    public void setMaxSize(Long maxSize) {
        this.maxSize = maxSize;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FileLimitationsEntity that = (FileLimitationsEntity) o;

        if (maxSize != null ? !maxSize.equals(that.maxSize) : that.maxSize != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = type != null ? type.hashCode() : 0;
        result = 31 * result + (maxSize != null ? maxSize.hashCode() : 0);
        return result;
    }
}
